<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function(){
	$("#r_mcnt").val("${sessionScope.recipeContent.rvo.r_mcnt}");
	
	$("#main_arrow_next").click(function(){
		if("${requestScope.temSaveIs}"!="임시저장"){
			alert("임시저장 버튼을 누르세요");
			return false;
		}
		$("#pForm_3").submit();
	});
	$("#main_arrow_prev").click(function(){
		if("${requestScope.temSaveIs}"!="임시저장"){
			alert("임시저장 버튼을 누르세요");
			return false;
		}
		location.href="recipe.do?command=update_move&page=2";
	});
	$("#main_ok").click(function(){
		if("${requestScope.temSaveIs}"!="임시저장"){
			alert("임시저장 버튼을 누르세요");
			return false;
		}
		if(confirm("수정 하시겠습니까?")){
			$("input[name=command]").val("update_submit");
			$("#pForm_3").submit();
		}
	});
	// 작성 취소 버튼
	$("#main_cancle").click(function(){
		if(confirm("작성을 취소하시겠습니까?")){
			location.href="recipe.do?command=write_cancle";
		}
	});
	//임시 저장 버튼
	$("#temSave").click(function(){
		$("input[name=command]").val("temSave");
		$("#pForm_3").submit();
	});
});

</script>
    
    
<div id="write_container">
<!-- 공통부분 -->
<div id="main_page1"><img src="${initParam.root }/img/main/main-write-page3.gif"></div>
<div id="main_arrow_prev"><input type="image" src="${initParam.root }/img/main/main-write-prev.gif"></div>
<div id="main_arrow_next"><input type="image" src="${initParam.root }/img/main/main-write-next.gif"></div>
<div id="main_info_prev"><img src="${initParam.root }/img/main/main-write-prev-info.jpg"></div>
<div id="main_info_next"><img src="${initParam.root }/img/main/main-update-next-info.gif"></div>
<div id="main_ok"><input type="image" src="${initParam.root }/img/main/main-update-ok.gif"></div>
<div id="main_cancle"><input type="image" src="${initParam.root }/img/main/main-update-cancle.gif"></div>
<!-- 여기부턴 이 페이지에서만 쓰임 -->
<div id="main_kind"><img src="${initParam.root }/img/main/main-write3-ready.gif"></div>
<div id="main_mctn"><img src="${initParam.root }/img/main/main-write3-mcnt.gif"></div>
<div id="main_mainIngre"><img src="${initParam.root }/img/main/main-write3-mainIngre.gif"></div>
<div id="main_subIngre"><img src="${initParam.root }/img/main/main-write3-subIngre.gif"></div>
	<div id="main_write_form">
	<!-- 데이터 전송용 폼 -->
 		<form id="pForm_3" action="recipe.do">
 		<input type="hidden" name="command" value="update">
 		<!-- page 값은 Controller에서 현재 페이지를 구분하기 위해 사용 -->
 		<input type="hidden" name="page" value="4">
 			<div id="main_mctn_select">
 			<select name="r_mcnt" id="r_mcnt">
				<option value="1">&nbsp;&nbsp;1&nbsp;&nbsp;</option>
				<option value="2">&nbsp;&nbsp;2&nbsp;&nbsp;</option>
				<option value="3">&nbsp;&nbsp;3&nbsp;&nbsp;</option>
				<option value="4">&nbsp;&nbsp;4&nbsp;&nbsp;</option>
			</select>인분
		</div>
 		<div id="main_mainIngre_text"><textarea id="main_mainIngre_textarea" cols="70" rows="7" name="r_main_ingre">${sessionScope.recipeContent.rvo.r_main_ingre}</textarea></div>
 		<div id="main_subIngre_text"><textarea id="main_subIngre_textarea" cols="70" rows="7" name="r_sub_ingre">${sessionScope.recipeContent.rvo.r_sub_ingre}</textarea></div>
 		<div class="main_temSave"><img src="${initParam.root }/img/main/main-update-temp.gif" id="temSave"></div>
 		</form>
 	</div>
</div>